package com.ty.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ty.enums.WarehouseStatus;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
@TableName(value = "`212_warehouse`",autoResultMap = true)
public class Warehouse extends BaseEntity{
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private Integer status;
    private String brief;
    @TableField(typeHandler = com.ty.typehandler.JsonTypeHandler.class)
    private List<String> img;

    private Integer seq;
    @TableField(exist = false)
    private String statusX;
    public String getStatusX (){
        WarehouseStatus warehouseStatus = WarehouseStatus.getByCode(this.getStatus());
        if(warehouseStatus != null){
            return warehouseStatus.getMessage();
        }
        return "未定义";
    }

}
